﻿using System;
using System.Windows.Forms;

using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;

using GameControls;
using GameDesignControls;
using G.Model;

namespace GameSharpAddin
{
    public class GamePanel : Panel, IDisposable
    {
        private BoardControl _BoardControl;
        private GameSpaceDef _GameDef;
        
        public GamePanel(GameSpaceDef pGameDef)
        {
            _GameDef = pGameDef;
            Initialize();
        }
        
        public BoardControl BoardControl
        {
            get { return _BoardControl; }
        }
        
        public GameSpaceDef GameDef
        {
            get { return _GameDef; }
        }
        
        void Initialize()
        {
            _BoardControl = new BoardControl();
            _BoardControl.GameDef = _GameDef;
            _BoardControl.Dock = DockStyle.Fill;
            Controls.Add(_BoardControl);
        }
        
        public void Disposable()
        {
            Controls.Remove(_BoardControl);
            _BoardControl.Dispose();
        }
        
    }
    
}
